import React from 'react';
import {Outlet, useNavigate} from "react-router-dom";
import GlobalHandler from "global/GlobalHandler";
import {useAppDispatch} from "../redux/hook";
import LoadingComponent from "../common/loading/LoadingComponent";

const globalHandler = GlobalHandler.getInstance() ;
const IndexPage = () => {
    const navigate = useNavigate() ;
    const dispatch = useAppDispatch() ;
    if (globalHandler.isNavigateLoaded()){
       globalHandler.setNavigate(navigate) ;
    }
    if (globalHandler.isDispatchLoaded()) {
        globalHandler.setDispatch(dispatch);
    }
    return (
        <React.Fragment>
            {/*<LoadingComponent/>*/}
            <Outlet/>
        </React.Fragment>
    );
};

export default IndexPage;